How To Build OVMF

Custom bioses for QEMU & UEFI

Home About Projects Blog Games Contact Support

!! NOTE !!: This assumes you are using an Ubuntu Linux host to build; I could not get this to work on Alpine, nor other distributions.

Initial Setup

$ sudo apt-get install build-essential git uuid-dev iasl nasm

$ git clone https://github.com/tianocore/edk2
$ cd edk2

$ git submodule update --init
$ source edksetup.sh
$ make -C BaseTools/

Building

For X86_64: $ build -a X64 -t GCC5 -b RELEASE -p Ovmf/OvmfPkgX64.dsc

Final output files should be under Build/OvmfX64/RELEASE_GCC5/FV/, or can use e.g. find Build -name OVMF.fd:

Adding/Removing DXE drivers or other customizing

Edit files OvmfPkg/OvmfPkgX64.dsc and OvmfPkg/OvmfPkgX64.fdf

For example, to add USB Mouse drivers for "Simple Pointer Protocol" and/or "Absolute Pointer Protocol".

! NOTE !: While you can add both simple and absolute pointer protocols, building with both usually has the Simple Pointer protocol "overwrite" the absolute pointer protocol for USB mouse devices. I recommend using one or the other, or building 2 separate OVMF.fd files, 1 for Simple Pointer, and 1 for Absolute Pointer.

Simple Pointer Protocol:

Absolute Pointer Protocol: